package com.vnp.cooking.fragmentKitchen;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;

import org.json.JSONException;
import org.json.JSONObject;

import com.loopj.android.http.AsyncHttpClient;
import com.loopj.android.http.RequestParams;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.vnp.cooking.DangCongThucActivity;
import com.vnp.cooking.R;
import com.vnp.cooking.UIcontrols.MyCircleImageView;
import com.vnp.cooking.httpclient.HttpClientHelper;
import com.vnp.cooking.httpclient.MyJsonHttpResponseHandler;
import com.vnp.cooking.utils.Common;
import com.vnp.cooking.utils.DecodeUtils;
import com.vnp.cooking.utils.PreferenceHelper;
import com.vnp.cooking.utils.Utils;

import android.app.Activity;
import android.content.Intent;
import android.database.Cursor;
import android.database.CursorJoiner.Result;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Bitmap.CompressFormat;
import android.graphics.Bitmap.Config;
import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ImageView.ScaleType;
import android.widget.TextView;
import android.widget.Toast;

public class CoverUser2 extends Fragment{

	View v;
	private static final String KEY_CONTENT = "FrgGianbepcuatoi:Content";
	private String mContent = "???";
	private static final String TEMP_COVER_FILE = "avatar.jpeg";
	private static final int CHANGE_AVATAR = -1;

	TextView txtDescription;
	PreferenceHelper preferenceHelper;

	public static CoverUser2 newInstance(String content) {
		CoverUser2 fragment = new CoverUser2();
		fragment.mContent = content;
		return fragment;
	}

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		if ((savedInstanceState != null)
				&& savedInstanceState.containsKey(KEY_CONTENT)) {
			mContent = savedInstanceState.getString(KEY_CONTENT);
		}
		preferenceHelper = new PreferenceHelper(getActivity());
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		v = (View) inflater.inflate(R.layout.cover_canhan_2, container, false);
		preferenceHelper = new PreferenceHelper(getActivity());
		txtDescription = (TextView) v.findViewById(R.id.txt_description);
		txtDescription.setText(preferenceHelper.getFriendAbout());
		
		setFont();
		
		return v;
	}
	
	private void setFont() {
		txtDescription.setTypeface(Utils.getTypefaceRegular(getActivity()));
	}
	

	void init() {
		
	}

	public void onSaveInstanceState(Bundle outState) {
		super.onSaveInstanceState(outState);
		outState.putString(KEY_CONTENT, mContent);
	}

}
